<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function createImgs(){
            //1.创建一个小猫图片
            var htmlImageElement = document.createElement("img");
            htmlImageElement.src="./img/1.png"
            htmlImageElement.width="100"

            //2.添加到document.body
            document.body.append(htmlImageElement) //这一步很重要！
        }
    </script>
</head>
<body>
<input type="button" onclick="createImgs()" value="点击创建小猫">
</body>
</html>